fix(rivetkit): remove drizzle-orm peer dep and add runtime version check#4492
Open
Conversation
|
🚅 Deployed to the rivet-pr-4492 environment in rivet-frontend
|
This was referenced Mar 24, 2026
Member
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
11 tasks
PR Review: fix(rivetkit): remove drizzle-orm peer dep and add runtime version check\n\nOverall this is a clean, well-scoped change. The runtime version check is a solid approach for optional feature dependencies. A few issues worth addressing.\n\n### Bug: Script exits 0 even when tests fail\n\ntest-drizzle-compat.sh uses set -euo pipefail but captures test failures with if/else, so those failures do not propagate. The script will exit 0 even if every version fails, making it useless in CI.\n\nAdd a final exit code check after the results summary.\n\n### Doc mismatch in CLAUDE.md\n\nThe new doc section says to update SUPPORTED_DRIZZLE_RANGE in mod.ts, but the actual constants are DRIZZLE_MIN and DRIZZLE_MAX. Should read: Update the DEFAULT_VERSIONS array in the script and DRIZZLE_MIN/DRIZZLE_MAX in src/db/drizzle/mod.ts when adding support for new drizzle releases.\n\n### Silent catch in checkDrizzleVersion could confuse future readers\n\nThe catch block silently swallows errors. If drizzle-orm is not installed, the require call will throw, but the real crash happens earlier at the ESM import level anyway. A comment would prevent this from looking like a silent failure bug.\n\n### Minor: Two-part version strings in isSupported\n\nDEFAULT_VERSIONS passes minor-only strings like 0.44 to pnpm add. If those ever reach isSupported, the split produces no patch segment. compareVersions handles this correctly via the ?? 0 fallback, treating it as 0.44.0. Worth a brief comment confirming this is intentional.\n\n### Nit: Script cleanup fallback\n\nThe pnpm install fallback in the cleanup trap (without --frozen-lockfile) could silently update the lockfile if the frozen install fails. Consider logging a warning rather than silently falling back to a mutable install.\n\n---\n\nGood change overall. The lazy check with drizzleVersionChecked, the createRequire pattern for ESM-safe JSON reads, and the backup/restore isolation in the test script are all solid choices. |
5478836 to
1514f08
Compare
86c1c7d to
2f7fec2
Compare
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: